
using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Client.Hotfix
{
    public class HttpResponse
    {
        public bool IsSuccess { get; set; }
        public string Error { get; set; }
        public string Text { get; set; }
        public byte[] Data { get; set; }
        public T DeserializeJson<T>()
        {
            try
            {
                return JsonConvert.DeserializeObject<T>(Text);
            }
            catch (Exception ex)
            {
                this.Error($"JSON解析失败: {ex.Message}");
                return default(T);
            }
        }
    }

}
